.class public Lcom/sponsorpay/sdk/android/utils/UrlBuilder;
.super Ljava/lang/Object;
.source "UrlBuilder.java"


# static fields
.field private static final ANDROID_ID_KEY:Ljava/lang/String; = "android_id"

.field private static final APPID_KEY:Ljava/lang/String; = "appid"

.field private static final APP_BUNDLE_NAME_KEY:Ljava/lang/String; = "app_bundle_name"

.field private static final APP_VERSION_KEY:Ljava/lang/String; = "app_version"

.field private static final CARRIER_COUNTRY_KEY:Ljava/lang/String; = "carrier_country"

.field private static final CARRIER_NAME_KEY:Ljava/lang/String; = "carrier_name"

.field private static final CURRENCY_KEY:Ljava/lang/String; = "currency"

.field private static final LANGUAGE_KEY:Ljava/lang/String; = "language"

.field private static final MANUFACTURER_KEY:Ljava/lang/String; = "manufacturer"

.field private static final NETWORK_CONNECTION_TYPE_KEY:Ljava/lang/String; = "network_connection_type"

.field private static final OS_VERSION_KEY:Ljava/lang/String; = "os_version"

.field private static final PHONE_VERSION_KEY:Ljava/lang/String; = "phone_version"

.field private static final SCREEN_DENSITY_CATEGORY_KEY:Ljava/lang/String; = "screen_density_category"

.field private static final SCREEN_DENSITY_X_KEY:Ljava/lang/String; = "screen_density_x"

.field private static final SCREEN_DENSITY_Y_KEY:Ljava/lang/String; = "screen_density_y"

.field private static final SCREEN_HEIGHT_KEY:Ljava/lang/String; = "screen_height"

.field private static final SCREEN_WIDTH_KEY:Ljava/lang/String; = "screen_width"

.field private static final SDK_RELEASE_VERSION_KEY:Ljava/lang/String; = "sdk_version"

.field private static final UDID_KEY:Ljava/lang/String; = "device_id"

.field public static final URL_PARAM_ALLOW_CAMPAIGN_KEY:Ljava/lang/String; = "allow_campaign"

.field public static final URL_PARAM_CURRENCY_NAME_KEY:Ljava/lang/String; = "currency"

.field public static final URL_PARAM_OFFSET_KEY:Ljava/lang/String; = "offset"

.field private static final URL_PARAM_SIGNATURE:Ljava/lang/String; = "signature"

.field public static final URL_PARAM_VALUE_ON:Ljava/lang/String; = "on"

.field private static final USERID_KEY:Ljava/lang/String; = "uid"

.field private static final WIFI_MAC_ADDRESS_KEY:Ljava/lang/String; = "mac_address"


# instance fields
.field private mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

.field private mCurrency:Ljava/lang/String;

.field private mExtraKeysValues:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private mResourceUrl:Ljava/lang/String;

.field private mShouldAddScreenMetrics:Z

.field private mShouldAddUserId:Z


# direct methods
.method protected constructor <init>(Ljava/lang/String;Lcom/sponsorpay/sdk/android/credentials/SPCredentials;)V
    .locals 1
    .parameter "resourceUrl"
    .parameter "credentials"

    .prologue
    .line 171
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 167
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mShouldAddUserId:Z

    .line 172
    iput-object p1, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mResourceUrl:Ljava/lang/String;

    .line 173
    iput-object p2, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    .line 174
    return-void
.end method

.method public static mapKeysToValues([Ljava/lang/String;[Ljava/lang/String;)Ljava/util/Map;
    .locals 6
    .parameter "keys"
    .parameter "values"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "([",
            "Ljava/lang/String;",
            "[",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 137
    array-length v4, p0

    array-length v5, p1

    if-eq v4, v5, :cond_0

    .line 138
    new-instance v4, Ljava/lang/IllegalArgumentException;

    const-string v5, "SponsorPay SDK: When specifying Custom Parameters using two arrays of Keys and Values, both must have the same length."

    invoke-direct {v4, v5}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 141
    :cond_0
    new-instance v2, Ljava/util/HashMap;

    array-length v4, p0

    invoke-direct {v2, v4}, Ljava/util/HashMap;-><init>(I)V

    .line 143
    .local v2, retval:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    array-length v4, p0

    if-lt v0, v4, :cond_1

    .line 156
    return-object v2

    .line 144
    :cond_1
    aget-object v1, p0, v0

    .line 145
    .local v1, k:Ljava/lang/String;
    aget-object v3, p1, v0

    .line 147
    .local v3, v:Ljava/lang/String;
    invoke-static {v1}, Lcom/sponsorpay/sdk/android/utils/StringUtils;->nullOrEmpty(Ljava/lang/String;)Z

    move-result v4

    if-nez v4, :cond_2

    invoke-static {v3}, Lcom/sponsorpay/sdk/android/utils/StringUtils;->nullOrEmpty(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 148
    :cond_2
    new-instance v4, Ljava/lang/IllegalArgumentException;

    const-string v5, "SponsorPay SDK: When specifying Custom Parameters using two arrays of Keys and Values, none of their elements can be empty or null."

    invoke-direct {v4, v5}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 153
    :cond_3
    invoke-virtual {v2, v1, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 143
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method public static newBuilder(Ljava/lang/String;Lcom/sponsorpay/sdk/android/credentials/SPCredentials;)Lcom/sponsorpay/sdk/android/utils/UrlBuilder;
    .locals 1
    .parameter "resourceUrl"
    .parameter "credentials"

    .prologue
    .line 291
    new-instance v0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;

    invoke-direct {v0, p0, p1}, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;-><init>(Ljava/lang/String;Lcom/sponsorpay/sdk/android/credentials/SPCredentials;)V

    return-object v0
.end method

.method public static validateKeyValueParams(Ljava/util/Map;)V
    .locals 3
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 112
    .local p0, kvParams:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    if-eqz p0, :cond_1

    .line 113
    invoke-interface {p0}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_2

    .line 122
    :cond_1
    return-void

    .line 113
    :cond_2
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 114
    .local v0, entry:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    invoke-static {v1}, Lcom/sponsorpay/sdk/android/utils/StringUtils;->nullOrEmpty(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_3

    .line 115
    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    invoke-static {v1}, Lcom/sponsorpay/sdk/android/utils/StringUtils;->nullOrEmpty(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 116
    :cond_3
    new-instance v1, Ljava/lang/IllegalArgumentException;

    .line 117
    const-string v2, "SponsorPay SDK: Custom Parameters cannot have an empty or null Key or Value."

    .line 116
    invoke-direct {v1, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v1
.end method


# virtual methods
.method public addExtraKeysValues(Ljava/util/Map;)Lcom/sponsorpay/sdk/android/utils/UrlBuilder;
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)",
            "Lcom/sponsorpay/sdk/android/utils/UrlBuilder;"
        }
    .end annotation

    .prologue
    .line 177
    .local p1, extraKeysValues:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    if-eqz p1, :cond_0

    .line 178
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mExtraKeysValues:Ljava/util/Map;

    if-nez v0, :cond_1

    .line 179
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0, p1}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V

    iput-object v0, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mExtraKeysValues:Ljava/util/Map;

    .line 184
    :cond_0
    :goto_0
    return-object p0

    .line 181
    :cond_1
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mExtraKeysValues:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->putAll(Ljava/util/Map;)V

    goto :goto_0
.end method

.method public addScreenMetrics()Lcom/sponsorpay/sdk/android/utils/UrlBuilder;
    .locals 1

    .prologue
    .line 188
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mShouldAddScreenMetrics:Z

    .line 189
    return-object p0
.end method

.method public buildUrl()Ljava/lang/String;
    .locals 10

    .prologue
    .line 210
    new-instance v3, Ljava/util/HashMap;

    invoke-direct {v3}, Ljava/util/HashMap;-><init>()V

    .line 212
    .local v3, keyValueParams:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    iget-boolean v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mShouldAddUserId:Z

    if-eqz v7, :cond_0

    .line 213
    const-string v7, "uid"

    iget-object v8, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-virtual {v8}, Lcom/sponsorpay/sdk/android/credentials/SPCredentials;->getUserId()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 216
    :cond_0
    iget-object v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-virtual {v7}, Lcom/sponsorpay/sdk/android/credentials/SPCredentials;->getHostInfo()Lcom/sponsorpay/sdk/android/utils/HostInfo;

    move-result-object v2

    .line 218
    .local v2, hostInfo:Lcom/sponsorpay/sdk/android/utils/HostInfo;
    const-string v7, "sdk_version"

    sget-object v8, Lcom/sponsorpay/sdk/android/SponsorPay;->RELEASE_VERSION_STRING:Ljava/lang/String;

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 219
    const-string v7, "appid"

    iget-object v8, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-virtual {v8}, Lcom/sponsorpay/sdk/android/credentials/SPCredentials;->getAppId()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 220
    const-string v7, "device_id"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getUDID()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 222
    const-string v7, "os_version"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getOsVersion()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 223
    const-string v7, "phone_version"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getPhoneVersion()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 224
    const-string v7, "language"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getLanguageSetting()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 225
    const-string v7, "android_id"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getAndroidId()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 226
    const-string v7, "mac_address"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getWifiMacAddress()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 228
    const-string v7, "carrier_name"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getCarrierName()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 229
    const-string v7, "carrier_country"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getCarrierCountry()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 230
    const-string v7, "network_connection_type"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getConnectionType()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 231
    const-string v7, "manufacturer"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getManufacturer()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 234
    const-string v7, "app_bundle_name"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getAppBundleName()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 235
    const-string v7, "app_version"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getAppVersion()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 237
    iget-object v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mCurrency:Ljava/lang/String;

    invoke-static {v7}, Lcom/sponsorpay/sdk/android/utils/StringUtils;->notNullNorEmpty(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_1

    .line 238
    const-string v7, "currency"

    iget-object v8, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mCurrency:Ljava/lang/String;

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 241
    :cond_1
    iget-boolean v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mShouldAddScreenMetrics:Z

    if-eqz v7, :cond_2

    .line 242
    const-string v7, "screen_width"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getScreenWidth()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 243
    const-string v7, "screen_height"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getScreenHeight()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 244
    const-string v7, "screen_density_x"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getScreenDensityX()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 245
    const-string v7, "screen_density_y"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getScreenDensityY()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 246
    const-string v7, "screen_density_category"

    invoke-virtual {v2}, Lcom/sponsorpay/sdk/android/utils/HostInfo;->getScreenDensityCategory()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v3, v7, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 249
    :cond_2
    iget-object v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mExtraKeysValues:Ljava/util/Map;

    if-eqz v7, :cond_3

    .line 250
    iget-object v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mExtraKeysValues:Ljava/util/Map;

    invoke-static {v7}, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->validateKeyValueParams(Ljava/util/Map;)V

    .line 251
    iget-object v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mExtraKeysValues:Ljava/util/Map;

    invoke-virtual {v3, v7}, Ljava/util/HashMap;->putAll(Ljava/util/Map;)V

    .line 254
    :cond_3
    invoke-static {}, Lcom/sponsorpay/sdk/android/utils/SponsorPayParametersProvider;->getParameters()Ljava/util/Map;

    move-result-object v5

    .line 255
    .local v5, spExtraParams:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    invoke-interface {v5}, Ljava/util/Map;->isEmpty()Z

    move-result v7

    if-nez v7, :cond_4

    .line 256
    invoke-virtual {v3, v5}, Ljava/util/HashMap;->putAll(Ljava/util/Map;)V

    .line 259
    :cond_4
    iget-object v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mResourceUrl:Ljava/lang/String;

    invoke-static {v7}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v6

    .line 260
    .local v6, uri:Landroid/net/Uri;
    invoke-virtual {v6}, Landroid/net/Uri;->buildUpon()Landroid/net/Uri$Builder;

    move-result-object v0

    .line 262
    .local v0, builder:Landroid/net/Uri$Builder;
    invoke-virtual {v3}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;

    move-result-object v7

    invoke-interface {v7}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v9

    :goto_0
    invoke-interface {v9}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-nez v7, :cond_6

    .line 266
    iget-object v7, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-virtual {v7}, Lcom/sponsorpay/sdk/android/credentials/SPCredentials;->getSecurityToken()Ljava/lang/String;

    move-result-object v4

    .line 267
    .local v4, secretKey:Ljava/lang/String;
    invoke-static {v4}, Lcom/sponsorpay/sdk/android/utils/StringUtils;->notNullNorEmpty(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_5

    .line 268
    const-string v7, "signature"

    .line 269
    invoke-static {v3, v4}, Lcom/sponsorpay/sdk/android/utils/SignatureTools;->generateSignatureForParameters(Ljava/util/Map;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    .line 268
    invoke-virtual {v0, v7, v8}, Landroid/net/Uri$Builder;->appendQueryParameter(Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri$Builder;

    .line 272
    :cond_5
    invoke-virtual {v0}, Landroid/net/Uri$Builder;->build()Landroid/net/Uri;

    move-result-object v6

    .line 274
    invoke-virtual {v6}, Landroid/net/Uri;->toString()Ljava/lang/String;

    move-result-object v7

    return-object v7

    .line 262
    .end local v4           #secretKey:Ljava/lang/String;
    :cond_6
    invoke-interface {v9}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map$Entry;

    .line 263
    .local v1, entry:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/String;

    invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Ljava/lang/String;

    invoke-virtual {v0, v7, v8}, Landroid/net/Uri$Builder;->appendQueryParameter(Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri$Builder;

    goto :goto_0
.end method

.method public sendUserId(Z)Lcom/sponsorpay/sdk/android/utils/UrlBuilder;
    .locals 0
    .parameter "shouldSend"

    .prologue
    .line 193
    iput-boolean p1, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mShouldAddUserId:Z

    .line 194
    return-object p0
.end method

.method public setCurrency(Ljava/lang/String;)Lcom/sponsorpay/sdk/android/utils/UrlBuilder;
    .locals 0
    .parameter "currency"

    .prologue
    .line 198
    iput-object p1, p0, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->mCurrency:Ljava/lang/String;

    .line 199
    return-object p0
.end method
